package com.atguigu.guli.service.sms.util;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@NoArgsConstructor
@AllArgsConstructor
@Data
@Component
//注意prefix要写到最后一个.符号之前
@ConfigurationProperties(prefix = "short.message")
public class SmsProperties implements InitializingBean {

    private String host;
    private String path;
    private String method;
    private String appCode;


    public static String HOST;
    public static String PATH;
    public static String METHOD;
    public static String APPCODE;

    @Override
    public void afterPropertiesSet() throws Exception {
        HOST = host;
        PATH = path;
        METHOD = method;
        APPCODE = appCode;

    }
}
